<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>欢迎页</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!--<link rel="stylesheet" href="css/bootstrap.min.css">-->

    <link rel="shortcut icon" href="favicon.ico">
    <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css?v=4.1.0" rel="stylesheet">
</head>
<body>
<div class="panel panel-default">
    <div class="panel-heading">注童</div>
    <div style="padding: 10px 0 20px 10px;">
        <!--<h3>&nbsp;&nbsp;&nbsp;项目介绍</h3>
        <ul>
            <li>面向学习型的开源框架，简洁高效，减少过渡封装，展现技术本质</li>
            <li>Springboot作为基础框架，使用mybatis作为持久层框架</li>
            <li>使用官方推荐的thymeleaf做为模板引擎，shiro作为安全框架,主流技术，“一网打尽”</li>
            <li>极简配置，一键前后台代码生成</li>
        </ul>-->

        <div class="row">
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>平台月报销售</h5>
                    </div>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="echarts-line-chart1"></div>
                    </div>
                </div>
            </div>
            

            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>平台年报销售</h5>
                    </div>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="echarts-line-chart2"></div>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>代理统计图</h5>
                    </div>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="echarts-line-chart3"></div>
                    </div>
                </div>
            </div>
        </div>


    </div>
</div>
<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
<script src="js/openTab.js"></script>
<!-- ECharts -->
<script src="/js/plugins/echarts/echarts-all.js"></script>
<!-- 自定义js -->
<script src="/js/content.js?v=1.0.0"></script>
<script language="JavaScript" th:inline="javascript">
    $(function () {
        //平台月报销售表
        var month1 = [1,2,3,4,5,6,7,8,9,10,11,12];
        var number1 = [];
        var money1 = [];
        var lineChart1 = echarts.init(document.getElementById("echarts-line-chart1"));
        var lineoption1 = {
            title: {
                text: '平台月销售额'
            },
            tooltip: {
                trigger: 'axis'
            },
            legend: {
                data: ['订单数量', '订单金额']
            },
            grid: {
                x: 70,
                y: 70,
                x2: 40,
                y2: 40
            },
            calculable: true,
            xAxis: [
                {
                    type: 'category',
                    boundaryGap: false,
                    data: month1
                }
            ],
            yAxis: [
                {
                    type: 'value',
                    axisLabel: {
                        formatter: '{value}'
                    }
                }
            ],
            series: [
                {
                    name: '订单数量',
                    type: 'line',
                    data: number1
                },
                {
                    name:'订单金额',
                    type:'line',
                    data: money1

                }
            ]
        };
        lineChart1.setOption(lineoption1);
        $(window).resize(lineChart1.resize);

        //历史销售总额
        var month2 = [1,2,3,4,5,6,7,8,9,10,11,12];
        var money2 = [];
        var number2 = [];
        var lineChart2 = echarts.init(document.getElementById("echarts-line-chart2"));
        var lineoption2 = {
            title: {
                text: '平台销售总额'
            },
            tooltip: {
                trigger: 'axis'
            },
            legend: {
                data: ['销售总额','订单总数']
            },
            grid: {
                x: 70,
                y: 70,
                x2: 40,
                y2: 40
            },
            calculable: true,
            xAxis: [
                {
                    type: 'category',
                    boundaryGap: false,
                    data: month2
                }
            ],
            yAxis: [
                {
                    type: 'value',
                    axisLabel: {
                        formatter: '{value}'
                    }
                }
            ],
            series: [
                {
                    name:'销售总额',
                    type:'line',
                    data: money2

                },
                {
                    name:'订单总数',
                    type:'line',
                    data: number2

                }
            ]
        };
        lineChart2.setOption(lineoption2);
        $(window).resize(lineChart2.resize);

        //代理统计
        var month3 = [1,2,3,4,5,6,7,8,9,10,11,12];
        var number3 = [];
        var number4 = [];
        var number5 = [];
        var number6 = [];
        var number7 = []; 
       // var number8 = []; 
        var lineChart3 = echarts.init(document.getElementById("echarts-line-chart3"));
        var lineoption3 = {
            title: {
                text: '代理统计'
            },
            tooltip: {
                trigger: 'axis'
            },
            legend: {
                data: ['省代','市代','县代','医生','患者']//,'总数'
            },
            grid: {
                x: 70,
                y: 70,
                x2: 40,
                y2: 40
            },
            calculable: true,
            xAxis: [
                {
                    type: 'category',
                    boundaryGap: false,
                    data: month3
                }
            ],
            yAxis: [
                {
                    type: 'value',
                    axisLabel: {
                        formatter: '{value}'
                    }
                }
            ],
            series: [
                {
                    name:'省代',
                    type:'line',
                    data: number3

                },
                {
                    name:'市代',
                    type:'line',
                    data: number4

                } ,
                {
                    name:'县代',
                    type:'line',
                    data: number5

                },
                {
                    name:'医生',
                    type:'line',
                    data: number6

                },
                {
                    name:'患者',
                    type:'line',
                    data: number7

                } /* ,
                {
                    name:'总数',
                    type:'line',
                    data: number8

                }  */
            ]
        };
        lineChart3.setOption(lineoption3);
        $(window).resize(lineChart3.resize);

        /*开始拿数据*/
        var prefix = '/wx/memberUser';
        lineChart1.showLoading();
        $.ajax({
            url : prefix+"/monthMoneyEcharts",
            type : "post",
            data : {
                id : ""
            },
            success : function(r) {
                if (r.code==0) {
                    money1 = r.money;
                    month1 = r.month;
                    number1 = r.number;
                    lineChart1.hideLoading();    //隐藏加载动画
                    lineChart1.setOption({
                        title: {
                            text: '平台月销售额'
                        },
                        tooltip: {
                            trigger: 'axis'
                        },
                        legend: {
                            data: ['订单数量', '订单金额'],
                            selected: {
                                // 选中'系列1'
                                '订单数量': false,
                                // 不选中'系列2'
                                '订单金额': true
                            }
                        },
                        grid: {
                            x: 70,
                            y: 70,
                            x2: 40,
                            y2: 40
                        },
                        calculable: true,
                        xAxis: [
                            {
                                type: 'category',
                                boundaryGap: false,
                                data: month1
                            }
                        ],
                        yAxis: [
                            {
                                type: 'value',
                                axisLabel: {
                                    formatter: '{value}'
                                }
                            }
                        ],
                        series: [
                            {
                                name: '订单数量',
                                type: 'line',
                                data: number1 ,
                                markPoint : {
                                    data: [
                                        {type: 'max', name: '最大金额'},
                                        {type: 'min', name: '最小金额'}
                                    ]
                                },
                            },
                            {
                                name:'订单金额',
                                type:'line',
                                data: money1,
                                markPoint : {
                                    data: [
                                        {type: 'max', name: '最大值'},
                                        {type: 'min', name: '最小值'}
                                    ]
                                }

                            }
                        ]
                    });
                    $(window).resize(lineChart1.resize);
                }
            }
        });

        lineChart2.showLoading();
        $.ajax({
            url : prefix+"/allMoneyEcharts",
            type : "post",
            data : {
                id : ""
            },
            success : function(r) {
                if (r.code==0) {
                    money2 = r.money;
                    month2 = r.month;
                    number2 = r.number;
                    lineChart2.hideLoading();    //隐藏加载动画
                    lineChart2.setOption({
                        title: {
                            text: '平台销售总额'
                        },
                        tooltip: {
                            trigger: 'axis'
                        },
                        legend: {
                            data: ['销售总额','订单总数'],
                            selected: {
                                // 选中'系列1'
                                '销售总额': true,
                                // 不选中'系列2'
                                '订单总数': false
                            }
                        },
                        grid: {
                            x: 70,
                            y: 70,
                            x2: 40,
                            y2: 40
                        },
                        calculable: true,
                        xAxis: [
                            {
                                type: 'category',
                                boundaryGap: false,
                                data: month2
                            }
                        ],
                        yAxis: [
                            {
                                type: 'value',
                                axisLabel: {
                                    formatter: '{value}'
                                }
                            }
                        ],
                        series: [
                            {
                                name:'销售总额',
                                type:'line',
                                data: money2,
                                markPoint : {
                                    data: [
                                        {type: 'max', name: '最大金额'},
                                        {type: 'min', name: '最小金额'}
                                    ]
                                }

                            },
                            {
                                name:'订单总数',
                                type:'line',
                                data: number2,
                                markPoint : {
                                    data: [
                                        {type: 'max', name: '最大值'},
                                        {type: 'min', name: '最小值'}
                                    ]
                                }

                            }
                        ]
                    });
                    $(window).resize(lineChart2.resize);
                }
            }
        });

        lineChart3.showLoading();
        $.ajax({
            url : prefix+"/allUserEcharts",
            type : "post",
            data : {
                id : ""
            },
            success : function(r) {
                if (r.code==0) {
                    month3 = r.month;
                    number3 = r.number0;
                    number4 = r.number1;
                    number5 = r.number2;
                    number6 = r.number3;
                    number7 = r.number4; 
                    //number8 = r.number; 
                    lineChart3.hideLoading();    //隐藏加载动画
                    lineChart3.setOption({
                        title: {
                            text: '代理统计'
                        },
                        tooltip: {
                            trigger: 'axis'
                        },
                        legend: {
                            data: ['省代','市代','县代','医生','患者'],//
                            selected: {
                                // 选中'系列1'
                                '省代': true,
                                // 不选中'系列2'
                                '市代': false,
                                '县代': false,
                                '医生': false,
                                '患者': false,
                               // '总数': false,
                            }
                        },
                        grid: {
                            x: 70,
                            y: 70,
                            x2: 40,
                            y2: 40
                        },
                        calculable: true,
                        xAxis: [
                            {
                                type: 'category',
                                boundaryGap: false,
                                data: month3
                            }
                        ],
                        yAxis: [
                            {
                                type: 'value',
                                axisLabel: {
                                    formatter: '{value}'
                                }
                            }
                        ],
                        series: [
                            {
                                name:'省代',
                                type:'line',
                                data: number3,
                                markPoint : {
                                    data: [
                                        {type: 'max', name: '最大值'}
                                    ]
                                }

                            },
                            {
                                name:'市代',
                                type:'line',
                                data: number4,
                                markPoint : {
                                    data: [
                                        {type: 'max', name: '最大值'}
                                    ]
                                }

                            } ,
                            {
                                name:'县代',
                                type:'line',
                                data: number5,
                                markPoint : {
                                    data: [
                                        {type: 'max', name: '最大值'}
                                    ]
                                }

                            },
                            {
                                name:'医生',
                                type:'line',
                                data: number6,
                                markPoint : {
                                    data: [
                                        {type: 'max', name: '最大值'}
                                    ]
                                }

                            },
                            {
                                name:'患者',
                                type:'line',
                                data: number7,
                                markPoint : {
                                    data: [
                                        {type: 'max', name: '最大值'}
                                    ]
                                }

                            } /* ,
                            {
                                name:'总数',
                                type:'line',
                                data: number8,
                                markPoint : {
                                    data: [
                                        {type: 'max', name: '最大值'}
                                    ]
                                }

                            }  */
                        ]
                    });
                    $(window).resize(lineChart3.resize);
                }
            }
        });

















    })


</script>


</body>
<!--<script src="js/jquery.min.js"></script>-->
</html>